package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Appajdbc {
    public static void main(String[] args)throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/test?useSSL=false";
        String name="root";
        String password="asd123asd123";
        String sql="INSERT INTO `user` (`username`, `password`)  VALUES  ('hh', MD5('123'))";
        Connection connection = DriverManager.getConnection(url, name, password);
        Statement statement = connection.createStatement();
        int i=statement.executeUpdate(sql);
        if(i>0){
            System.out.println("插入成功！");
    }
}
}
